/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    hansen
 * 创建时间:    2023-09-20
 */
package org.jeecg.modules.dock.handler.impl;

import cn.hutool.core.collection.CollectionUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.dock.entity.dto.request.CustomerSuppliedMaterialRequestDTO;
import org.jeecg.modules.dock.entity.dto.response.SapBaseResponseDTO;
import org.jeecg.modules.dock.enums.SapInterfaceTypeEnum;
import org.jeecg.modules.dock.handler.AbstractSapDataHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * 客供料同步接口handler
 *
 * @author hansen
 * @version 1.0.0
 * @date 2023-09-20 15:23:53
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class CustomerSuppliedMaterialSyncHandler extends AbstractSapDataHandler<CustomerSuppliedMaterialRequestDTO> {

    @Value(value = "${wms.config.personnel.sap:}")
    private String personnelSap;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public synchronized List<? extends SapBaseResponseDTO> doHandle(List<CustomerSuppliedMaterialRequestDTO> data) {
        List<SapBaseResponseDTO> dtoList = new ArrayList<>(16);
        SapBaseResponseDTO responseDTO = new SapBaseResponseDTO();
        log.info("客供料同步接口:{},\n共{}条", data, data.size());
        if (CollectionUtil.isNotEmpty(data)) {


        }
        return dtoList;
    }

    @Override
    public SapInterfaceTypeEnum type() {
        return SapInterfaceTypeEnum.CUSTOMER_SUPPLIED_MATERIAL_SYNC;
    }
}
